package com.nutquest.common.mapdata;

import com.nutquest.common.dataobjects.*;

import java.util.*;

/**
 * This
 * 
 * @author Paul and Cobus
 * 
 */
public class MapOne implements IMapData {

	private static final long serialVersionUID = 666626376681281412L;

	private Terrain[] map = new Terrain[441];

	final static int MAP_WIDTH = 21;
	final static int MAP_HEIGHT = 21;

	public MapOne() {
		// terrain data
		ArrayList<Object> nuts = new ArrayList<Object>();
		nuts.add(new Nut(Nut.NutType.ACORN));

		// ------------------- R O W 0 ------------------------------------
		map[0] = new Terrain(Terrain.TerrainType.TREE, 0, 0);
		map[1] = new Terrain(Terrain.TerrainType.TREE, 1, 0);
		map[2] = new Terrain(Terrain.TerrainType.GRASS, 2, 0);
		map[3] = new Terrain(Terrain.TerrainType.GRASS, 3, 0);
		map[4] = new Terrain(Terrain.TerrainType.GRASS, 4, 0);
		map[5] = new Terrain(Terrain.TerrainType.GRASS, 5, 0);
		map[6] = new Terrain(Terrain.TerrainType.GRASS, 6, 0);
		map[7] = new Terrain(Terrain.TerrainType.GRASS, 7, 0);
		map[8] = new Terrain(Terrain.TerrainType.GRASS, 8, 0);
		map[9] = new Terrain(Terrain.TerrainType.TREE, 9, 0);
		map[10] = new Terrain(Terrain.TerrainType.TREE, 10, 0);
		map[11] = new Terrain(Terrain.TerrainType.GRASS, 11, 0);
		map[12] = new Terrain(Terrain.TerrainType.GRASS, 12, 0);
		map[13] = new Terrain(Terrain.TerrainType.GRASS, nuts, 13, 0);
		map[14] = new Terrain(Terrain.TerrainType.GRASS, 14, 0);
		map[15] = new Terrain(Terrain.TerrainType.GRASS, 15, 0);
		map[16] = new Terrain(Terrain.TerrainType.GRASS, 16, 0);
		map[17] = new Terrain(Terrain.TerrainType.GRASS, 17, 0);
		map[18] = new Terrain(Terrain.TerrainType.GRASS, 18, 0);
		map[19] = new Terrain(Terrain.TerrainType.TREE, 19, 0);
		map[20] = new Terrain(Terrain.TerrainType.TREE, 20, 0);

		// ------------------- R O W 1 ------------------------------------
		map[21] = new Terrain(Terrain.TerrainType.TREE, 0, 1);
		map[22] = new Terrain(Terrain.TerrainType.TREE, 1, 1);
		map[23] = new Terrain(Terrain.TerrainType.GRASS, 2, 1);
		map[24] = new Terrain(Terrain.TerrainType.GRASS, 3, 1);
		map[25] = new Terrain(Terrain.TerrainType.GRASS, 4, 1);
		map[26] = new Terrain(Terrain.TerrainType.TREE_ROOT_TOP_TIP, 5, 1);
		map[27] = new Terrain(Terrain.TerrainType.GRASS, 6, 1);
		map[28] = new Terrain(Terrain.TerrainType.GRASS, 7, 1);
		map[29] = new Terrain(Terrain.TerrainType.GRASS, 8, 1);
		map[30] = new Terrain(Terrain.TerrainType.TREE, 9, 1);
		map[31] = new Terrain(Terrain.TerrainType.TREE, 10, 1);
		map[32] = new Terrain(Terrain.TerrainType.GRASS, 11, 1);
		map[33] = new Terrain(Terrain.TerrainType.GRASS, 12, 1);
		map[34] = new Terrain(Terrain.TerrainType.GRASS, 13, 1);
		map[35] = new Terrain(Terrain.TerrainType.GRASS, 14, 1);
		map[36] = new Terrain(Terrain.TerrainType.TREE_ROOT_TOP_TIP, 15, 1);
		map[37] = new Terrain(Terrain.TerrainType.GRASS, 16, 1);
		map[38] = new Terrain(Terrain.TerrainType.GRASS, 17, 1);
		map[39] = new Terrain(Terrain.TerrainType.GRASS, 18, 1);
		map[40] = new Terrain(Terrain.TerrainType.TREE, 19, 1);
		map[41] = new Terrain(Terrain.TerrainType.TREE, 20, 1);

		// ------------------- R O W 2 ------------------------------------
		map[42] = new Terrain(Terrain.TerrainType.GRASS, 0, 2);
		map[43] = new Terrain(Terrain.TerrainType.GRASS, 1, 2);
		map[44] = new Terrain(Terrain.TerrainType.GRASS, 2, 2);
		map[45] = new Terrain(Terrain.TerrainType.GRASS, 3, 2);
		map[46] = new Terrain(Terrain.TerrainType.GRASS, 4, 2);
		map[47] = new Terrain(Terrain.TerrainType.TREE_ROOT_TOP_MID, 5, 2);
		map[48] = new Terrain(Terrain.TerrainType.GRASS, 6, 2);
		map[49] = new Terrain(Terrain.TerrainType.GRASS, 7, 2);
		map[50] = new Terrain(Terrain.TerrainType.GRASS, 8, 2);
		map[51] = new Terrain(Terrain.TerrainType.GRASS, 9, 2);
		map[52] = new Terrain(Terrain.TerrainType.GRASS, 10, 2);
		map[53] = new Terrain(Terrain.TerrainType.GRASS, 11, 2);
		map[54] = new Terrain(Terrain.TerrainType.GRASS, 12, 2);
		map[55] = new Terrain(Terrain.TerrainType.GRASS, 13, 2);
		map[56] = new Terrain(Terrain.TerrainType.GRASS, 14, 2);
		map[57] = new Terrain(Terrain.TerrainType.TREE_ROOT_TOP_MID, 15, 2);
		map[58] = new Terrain(Terrain.TerrainType.GRASS, 16, 2);
		map[59] = new Terrain(Terrain.TerrainType.GRASS, 17, 2);
		map[60] = new Terrain(Terrain.TerrainType.GRASS, 18, 2);
		map[61] = new Terrain(Terrain.TerrainType.GRASS, 19, 2);
		map[62] = new Terrain(Terrain.TerrainType.GRASS, 20, 2);

		// ------------------- R O W 3 ------------------------------------
		map[63] = new Terrain(Terrain.TerrainType.GRASS, 0, 3);
		map[64] = new Terrain(Terrain.TerrainType.GRASS, 1, 3);
		map[65] = new Terrain(Terrain.TerrainType.GRASS, 2, 3);
		map[66] = new Terrain(Terrain.TerrainType.GRASS, 3, 3);
		map[67] = new Terrain(Terrain.TerrainType.GRASS, 4, 3);
		map[68] = new Terrain(Terrain.TerrainType.TREE_ROOT_TOP_BASE, 5, 3);
		map[69] = new Terrain(Terrain.TerrainType.GRASS, 6, 3);
		map[70] = new Terrain(Terrain.TerrainType.GRASS, 7, 3);
		map[71] = new Terrain(Terrain.TerrainType.GRASS, 8, 3);
		map[72] = new Terrain(Terrain.TerrainType.GRASS, 9, 3);
		map[73] = new Terrain(Terrain.TerrainType.GRASS, 10, 3);
		map[74] = new Terrain(Terrain.TerrainType.GRASS, 11, 3);
		map[75] = new Terrain(Terrain.TerrainType.GRASS, 12, 3);
		map[76] = new Terrain(Terrain.TerrainType.GRASS, 13, 3);
		map[77] = new Terrain(Terrain.TerrainType.GRASS, 14, 3);
		map[78] = new Terrain(Terrain.TerrainType.TREE_ROOT_TOP_BASE, 15, 3);
		map[79] = new Terrain(Terrain.TerrainType.GRASS, 16, 3);
		map[80] = new Terrain(Terrain.TerrainType.GRASS, 17, 3);
		map[81] = new Terrain(Terrain.TerrainType.GRASS, 18, 3);
		map[82] = new Terrain(Terrain.TerrainType.GRASS, 19, 3);
		map[83] = new Terrain(Terrain.TerrainType.GRASS, 20, 3);

		// ------------------- R O W 4 ------------------------------------
		map[84] = new Terrain(Terrain.TerrainType.GRASS, 0, 4);
		map[85] = new Terrain(Terrain.TerrainType.GRASS, 1, 4);
		map[86] = new Terrain(Terrain.TerrainType.GRASS, 2, 4);
		map[87] = new Terrain(Terrain.TerrainType.GRASS, 3, 4);
		map[88] = new Terrain(Terrain.TerrainType.TREE_CORE_TOP_LEFT, 4, 4);
		map[89] = new Terrain(Terrain.TerrainType.TREE_CORE_MID_TOP, 5, 4);
		map[90] = new Terrain(Terrain.TerrainType.TREE_CORE_TOP_RIGHT, 6, 4);
		map[91] = new Terrain(Terrain.TerrainType.GRASS, 7, 4);
		map[92] = new Terrain(Terrain.TerrainType.GRASS, 8, 4);
		map[93] = new Terrain(Terrain.TerrainType.GRASS, 9, 4);
		map[94] = new Terrain(Terrain.TerrainType.GRASS, 10, 4);
		map[95] = new Terrain(Terrain.TerrainType.GRASS, 11, 4);
		map[96] = new Terrain(Terrain.TerrainType.GRASS, 12, 4);
		map[97] = new Terrain(Terrain.TerrainType.GRASS, 13, 4);
		map[98] = new Terrain(Terrain.TerrainType.TREE_CORE_TOP_LEFT, 14, 4);
		map[99] = new Terrain(Terrain.TerrainType.TREE_CORE_MID_TOP, 15, 4);
		map[100] = new Terrain(Terrain.TerrainType.TREE_CORE_TOP_RIGHT, 16, 4);
		map[101] = new Terrain(Terrain.TerrainType.GRASS, 17, 4);
		map[102] = new Terrain(Terrain.TerrainType.GRASS, 18, 4);
		map[103] = new Terrain(Terrain.TerrainType.GRASS, 19, 4);
		map[104] = new Terrain(Terrain.TerrainType.GRASS, 20, 4);

		// ------------------- R O W 5 ------------------------------------
		map[105] = new Terrain(Terrain.TerrainType.GRASS, 0, 5);
		map[106] = new Terrain(Terrain.TerrainType.TREE, 1, 5);
		map[107] = new Terrain(Terrain.TerrainType.TREE, 2, 5);
		map[108] = new Terrain(Terrain.TerrainType.TREE, 3, 5);
		map[109] = new Terrain(Terrain.TerrainType.TREE, 4, 5);
		map[110] = new Terrain(Terrain.TerrainType.TREE, 5, 5);
		map[111] = new Terrain(Terrain.TerrainType.TREE, 6, 5);
		map[112] = new Terrain(Terrain.TerrainType.TREE, 7, 5);
		map[113] = new Terrain(Terrain.TerrainType.TREE, 8, 5);
		map[114] = new Terrain(Terrain.TerrainType.TREE, 9, 5);
		map[115] = new Terrain(Terrain.TerrainType.GRASS, 10, 5);
		map[116] = new Terrain(Terrain.TerrainType.TREE, 11, 5);
		map[117] = new Terrain(Terrain.TerrainType.TREE, 12, 5);
		map[118] = new Terrain(Terrain.TerrainType.TREE, 13, 5);
		map[119] = new Terrain(Terrain.TerrainType.TREE, 14, 5);
		map[120] = new Terrain(Terrain.TerrainType.TREE, 15, 5);
		map[121] = new Terrain(Terrain.TerrainType.TREE, 16, 5);
		map[122] = new Terrain(Terrain.TerrainType.TREE, 17, 5);
		map[123] = new Terrain(Terrain.TerrainType.TREE, 18, 5);
		map[124] = new Terrain(Terrain.TerrainType.TREE, 19, 5);
		map[125] = new Terrain(Terrain.TerrainType.GRASS, 20, 5);

		// ------------------- R O W 6 ------------------------------------
		map[126] = new Terrain(Terrain.TerrainType.GRASS, 0, 6);
		map[127] = new Terrain(Terrain.TerrainType.GRASS, 1, 6);
		map[128] = new Terrain(Terrain.TerrainType.GRASS, 2, 6);
		map[129] = new Terrain(Terrain.TerrainType.GRASS, 3, 6);
		map[130] = new Terrain(Terrain.TerrainType.TREE, 4, 6);
		map[131] = new Terrain(Terrain.TerrainType.TREE, 5, 6);
		map[132] = new Terrain(Terrain.TerrainType.TREE, 6, 6);
		map[133] = new Terrain(Terrain.TerrainType.GRASS, 7, 6);
		map[134] = new Terrain(Terrain.TerrainType.GRASS, 8, 6);
		map[135] = new Terrain(Terrain.TerrainType.GRASS, 9, 6);
		map[136] = new Terrain(Terrain.TerrainType.GRASS, 10, 6);
		map[137] = new Terrain(Terrain.TerrainType.GRASS, 11, 6);
		map[138] = new Terrain(Terrain.TerrainType.GRASS, 12, 6);
		map[139] = new Terrain(Terrain.TerrainType.GRASS, 13, 6);
		map[140] = new Terrain(Terrain.TerrainType.TREE, 14, 6);
		map[141] = new Terrain(Terrain.TerrainType.TREE, 15, 6);
		map[142] = new Terrain(Terrain.TerrainType.TREE, 16, 6);
		map[143] = new Terrain(Terrain.TerrainType.GRASS, 17, 6);
		map[144] = new Terrain(Terrain.TerrainType.GRASS, 18, 6);
		map[145] = new Terrain(Terrain.TerrainType.GRASS, 19, 6);
		map[146] = new Terrain(Terrain.TerrainType.GRASS, 20, 6);

		// ------------------- R O W 7 ------------------------------------
		map[147] = new Terrain(Terrain.TerrainType.GRASS, 0, 7);
		map[148] = new Terrain(Terrain.TerrainType.GRASS, 1, 7);
		map[149] = new Terrain(Terrain.TerrainType.GRASS, 2, 7);
		map[150] = new Terrain(Terrain.TerrainType.GRASS, 3, 7);
		map[151] = new Terrain(Terrain.TerrainType.GRASS, 4, 7);
		map[152] = new Terrain(Terrain.TerrainType.TREE, 5, 7);
		map[153] = new Terrain(Terrain.TerrainType.GRASS, 6, 7);
		map[154] = new Terrain(Terrain.TerrainType.GRASS, 7, 7);
		map[155] = new Terrain(Terrain.TerrainType.GRASS, 8, 7);
		map[156] = new Terrain(Terrain.TerrainType.GRASS, 9, 7);
		map[157] = new Terrain(Terrain.TerrainType.GRASS, 10, 7);
		map[158] = new Terrain(Terrain.TerrainType.GRASS, 11, 7);
		map[159] = new Terrain(Terrain.TerrainType.GRASS, 12, 7);
		map[160] = new Terrain(Terrain.TerrainType.GRASS, 13, 7);
		map[161] = new Terrain(Terrain.TerrainType.GRASS, 14, 7);
		map[162] = new Terrain(Terrain.TerrainType.TREE, 15, 7);
		map[163] = new Terrain(Terrain.TerrainType.GRASS, 16, 7);
		map[164] = new Terrain(Terrain.TerrainType.GRASS, 17, 7);
		map[165] = new Terrain(Terrain.TerrainType.GRASS, 18, 7);
		map[166] = new Terrain(Terrain.TerrainType.GRASS, 19, 7);
		map[167] = new Terrain(Terrain.TerrainType.GRASS, 20, 7);

		// ------------------- R O W 8 ------------------------------------
		map[168] = new Terrain(Terrain.TerrainType.GRASS, 0, 8);
		map[169] = new Terrain(Terrain.TerrainType.GRASS, 1, 8);
		map[170] = new Terrain(Terrain.TerrainType.GRASS, 2, 8);
		map[171] = new Terrain(Terrain.TerrainType.GRASS, 3, 8);
		map[172] = new Terrain(Terrain.TerrainType.GRASS, 4, 8);
		map[173] = new Terrain(Terrain.TerrainType.TREE, 5, 8);
		map[174] = new Terrain(Terrain.TerrainType.GRASS, 6, 8);
		map[175] = new Terrain(Terrain.TerrainType.GRASS, 7, 8);
		map[176] = new Terrain(Terrain.TerrainType.WATER, 8, 8);
		map[177] = new Terrain(Terrain.TerrainType.WATER, 9, 8);
		map[178] = new Terrain(Terrain.TerrainType.WATER, 10, 8);
		map[179] = new Terrain(Terrain.TerrainType.WATER, 11, 8);
		map[180] = new Terrain(Terrain.TerrainType.WATER, 12, 8);
		map[181] = new Terrain(Terrain.TerrainType.GRASS, 13, 8);
		map[182] = new Terrain(Terrain.TerrainType.GRASS, 14, 8);
		map[183] = new Terrain(Terrain.TerrainType.TREE, 15, 8);
		map[184] = new Terrain(Terrain.TerrainType.GRASS, 16, 8);
		map[185] = new Terrain(Terrain.TerrainType.GRASS, 17, 8);
		map[186] = new Terrain(Terrain.TerrainType.GRASS, 18, 8);
		map[187] = new Terrain(Terrain.TerrainType.GRASS, 19, 8);
		map[188] = new Terrain(Terrain.TerrainType.GRASS, 20, 8);

		// ------------------- R O W 9 ------------------------------------
		map[189] = new Terrain(Terrain.TerrainType.GRASS, 0, 9);
		map[190] = new Terrain(Terrain.TerrainType.TREE, 1, 9);
		map[191] = new Terrain(Terrain.TerrainType.TREE, 2, 9);
		map[192] = new Terrain(Terrain.TerrainType.GRASS, 3, 9);
		map[193] = new Terrain(Terrain.TerrainType.GRASS, 4, 9);
		map[194] = new Terrain(Terrain.TerrainType.TREE, 5, 9);
		map[195] = new Terrain(Terrain.TerrainType.GRASS, 6, 9);
		map[196] = new Terrain(Terrain.TerrainType.GRASS, 7, 9);
		map[197] = new Terrain(Terrain.TerrainType.WATER, 8, 9);
		map[198] = new Terrain(Terrain.TerrainType.WATER, 9, 9);
		map[199] = new Terrain(Terrain.TerrainType.WATER, 10, 9);
		map[200] = new Terrain(Terrain.TerrainType.WATER, 11, 9);
		map[201] = new Terrain(Terrain.TerrainType.WATER, 12, 9);
		map[202] = new Terrain(Terrain.TerrainType.GRASS, 13, 9);
		map[203] = new Terrain(Terrain.TerrainType.GRASS, 14, 9);
		map[204] = new Terrain(Terrain.TerrainType.TREE, 15, 9);
		map[205] = new Terrain(Terrain.TerrainType.GRASS, 16, 9);
		map[206] = new Terrain(Terrain.TerrainType.GRASS, 17, 9);
		map[207] = new Terrain(Terrain.TerrainType.TREE, 18, 9);
		map[208] = new Terrain(Terrain.TerrainType.TREE, 19, 9);
		map[209] = new Terrain(Terrain.TerrainType.GRASS, 20, 9);

		// ------------------- R O W 10 ------------------------------------
		map[210] = new Terrain(Terrain.TerrainType.GRASS, 0, 10);
		map[211] = new Terrain(Terrain.TerrainType.TREE, 1, 10);
		map[212] = new Terrain(Terrain.TerrainType.TREE, 2, 10);
		map[213] = new Terrain(Terrain.TerrainType.GRASS, 3, 10);
		map[214] = new Terrain(Terrain.TerrainType.GRASS, 4, 10);
		map[215] = new Terrain(Terrain.TerrainType.GRASS, 5, 10);
		map[216] = new Terrain(Terrain.TerrainType.GRASS, 6, 10);
		map[217] = new Terrain(Terrain.TerrainType.GRASS, 7, 10);
		map[218] = new Terrain(Terrain.TerrainType.WATER, 8, 10);
		map[219] = new Terrain(Terrain.TerrainType.WATER, 9, 10);
		map[220] = new Terrain(Terrain.TerrainType.WATER, 10, 9);
		map[221] = new Terrain(Terrain.TerrainType.WATER, 11, 10);
		map[222] = new Terrain(Terrain.TerrainType.WATER, 12, 10);
		map[223] = new Terrain(Terrain.TerrainType.GRASS, 13, 10);
		map[224] = new Terrain(Terrain.TerrainType.GRASS, 14, 10);
		map[225] = new Terrain(Terrain.TerrainType.GRASS, 15, 10);
		map[226] = new Terrain(Terrain.TerrainType.GRASS, 16, 10);
		map[227] = new Terrain(Terrain.TerrainType.GRASS, 17, 10);
		map[228] = new Terrain(Terrain.TerrainType.TREE, 18, 10);
		map[229] = new Terrain(Terrain.TerrainType.TREE, 19, 10);
		map[230] = new Terrain(Terrain.TerrainType.GRASS, 20, 10);

		// ------------------- R O W 11 ------------------------------------
		map[231] = new Terrain(Terrain.TerrainType.GRASS, 0, 11);
		map[232] = new Terrain(Terrain.TerrainType.GRASS, 1, 11);
		map[233] = new Terrain(Terrain.TerrainType.GRASS, 2, 11);
		map[234] = new Terrain(Terrain.TerrainType.GRASS, 3, 11);
		map[235] = new Terrain(Terrain.TerrainType.GRASS, 4, 11);
		map[236] = new Terrain(Terrain.TerrainType.TREE, 5, 11);
		map[237] = new Terrain(Terrain.TerrainType.GRASS, 6, 11);
		map[238] = new Terrain(Terrain.TerrainType.GRASS, 7, 11);
		map[239] = new Terrain(Terrain.TerrainType.WATER, 8, 11);
		map[240] = new Terrain(Terrain.TerrainType.WATER, 9, 11);
		map[241] = new Terrain(Terrain.TerrainType.WATER, 10, 11);
		map[242] = new Terrain(Terrain.TerrainType.WATER, 11, 11);
		map[243] = new Terrain(Terrain.TerrainType.WATER, 12, 11);
		map[244] = new Terrain(Terrain.TerrainType.GRASS, 13, 11);
		map[245] = new Terrain(Terrain.TerrainType.GRASS, 14, 11);
		map[246] = new Terrain(Terrain.TerrainType.TREE, 15, 11);
		map[247] = new Terrain(Terrain.TerrainType.GRASS, 16, 11);
		map[248] = new Terrain(Terrain.TerrainType.GRASS, 17, 11);
		map[249] = new Terrain(Terrain.TerrainType.GRASS, 18, 11);
		map[250] = new Terrain(Terrain.TerrainType.GRASS, 19, 11);
		map[251] = new Terrain(Terrain.TerrainType.GRASS, 20, 11);

		// ------------------- R O W 12 ------------------------------------
		map[252] = new Terrain(Terrain.TerrainType.GRASS, 0, 12);
		map[253] = new Terrain(Terrain.TerrainType.GRASS, 1, 12);
		map[254] = new Terrain(Terrain.TerrainType.GRASS, 2, 12);
		map[255] = new Terrain(Terrain.TerrainType.GRASS, 3, 12);
		map[256] = new Terrain(Terrain.TerrainType.GRASS, 4, 12);
		map[257] = new Terrain(Terrain.TerrainType.TREE, 5, 12);
		map[258] = new Terrain(Terrain.TerrainType.GRASS, 6, 12);
		map[259] = new Terrain(Terrain.TerrainType.GRASS, 7, 12);
		map[260] = new Terrain(Terrain.TerrainType.WATER, 8, 12);
		map[261] = new Terrain(Terrain.TerrainType.WATER, 9, 12);
		map[262] = new Terrain(Terrain.TerrainType.WATER, 10, 12);
		map[263] = new Terrain(Terrain.TerrainType.WATER, 11, 12);
		map[264] = new Terrain(Terrain.TerrainType.WATER, 12, 12);
		map[265] = new Terrain(Terrain.TerrainType.GRASS, 13, 12);
		map[266] = new Terrain(Terrain.TerrainType.GRASS, 14, 12);
		map[267] = new Terrain(Terrain.TerrainType.TREE, 15, 12);
		map[268] = new Terrain(Terrain.TerrainType.GRASS, 16, 12);
		map[269] = new Terrain(Terrain.TerrainType.GRASS, 17, 12);
		map[270] = new Terrain(Terrain.TerrainType.GRASS, 18, 12);
		map[271] = new Terrain(Terrain.TerrainType.GRASS, 19, 12);
		map[272] = new Terrain(Terrain.TerrainType.GRASS, 20, 12);

		// ------------------- R O W 13 ------------------------------------
		map[273] = new Terrain(Terrain.TerrainType.GRASS, 0, 13);
		map[274] = new Terrain(Terrain.TerrainType.GRASS, 1, 13);
		map[275] = new Terrain(Terrain.TerrainType.GRASS, 2, 13);
		map[276] = new Terrain(Terrain.TerrainType.GRASS, 3, 13);
		map[277] = new Terrain(Terrain.TerrainType.GRASS, 4, 13);
		map[278] = new Terrain(Terrain.TerrainType.TREE, 5, 13);
		map[279] = new Terrain(Terrain.TerrainType.GRASS, 6, 13);
		map[280] = new Terrain(Terrain.TerrainType.GRASS, 7, 13);
		map[281] = new Terrain(Terrain.TerrainType.GRASS, 8, 13);
		map[282] = new Terrain(Terrain.TerrainType.GRASS, 9, 13);
		map[283] = new Terrain(Terrain.TerrainType.GRASS, 10, 13);
		map[284] = new Terrain(Terrain.TerrainType.GRASS, 11, 13);
		map[285] = new Terrain(Terrain.TerrainType.GRASS, 12, 13);
		map[286] = new Terrain(Terrain.TerrainType.GRASS, 13, 13);
		map[287] = new Terrain(Terrain.TerrainType.GRASS, 14, 13);
		map[288] = new Terrain(Terrain.TerrainType.TREE, 15, 13);
		map[289] = new Terrain(Terrain.TerrainType.GRASS, 16, 13);
		map[290] = new Terrain(Terrain.TerrainType.GRASS, 17, 13);
		map[291] = new Terrain(Terrain.TerrainType.GRASS, 18, 13);
		map[292] = new Terrain(Terrain.TerrainType.GRASS, 19, 13);
		map[293] = new Terrain(Terrain.TerrainType.GRASS, 20, 13);

		// ------------------- R O W 14 ------------------------------------
		map[294] = new Terrain(Terrain.TerrainType.GRASS, 0, 14);
		map[295] = new Terrain(Terrain.TerrainType.GRASS, 1, 14);
		map[296] = new Terrain(Terrain.TerrainType.GRASS, 2, 14);
		map[297] = new Terrain(Terrain.TerrainType.GRASS, 3, 14);
		map[298] = new Terrain(Terrain.TerrainType.TREE, 4, 14);
		map[299] = new Terrain(Terrain.TerrainType.TREE, 5, 14);
		map[300] = new Terrain(Terrain.TerrainType.TREE, 6, 14);
		map[301] = new Terrain(Terrain.TerrainType.GRASS, 7, 14);
		map[302] = new Terrain(Terrain.TerrainType.GRASS, 8, 14);
		map[303] = new Terrain(Terrain.TerrainType.GRASS, 9, 14);
		map[304] = new Terrain(Terrain.TerrainType.GRASS, 10, 14);
		map[305] = new Terrain(Terrain.TerrainType.GRASS, 11, 14);
		map[306] = new Terrain(Terrain.TerrainType.GRASS, 12, 14);
		map[307] = new Terrain(Terrain.TerrainType.GRASS, 13, 14);
		map[308] = new Terrain(Terrain.TerrainType.TREE, 14, 14);
		map[309] = new Terrain(Terrain.TerrainType.TREE, 15, 14);
		map[310] = new Terrain(Terrain.TerrainType.TREE, 16, 14);
		map[311] = new Terrain(Terrain.TerrainType.GRASS, 17, 14);
		map[312] = new Terrain(Terrain.TerrainType.GRASS, 18, 14);
		map[313] = new Terrain(Terrain.TerrainType.GRASS, 19, 14);
		map[314] = new Terrain(Terrain.TerrainType.GRASS, 20, 14);

		// ------------------- R O W 15 ------------------------------------
		map[315] = new Terrain(Terrain.TerrainType.GRASS, 0, 15);
		map[316] = new Terrain(Terrain.TerrainType.TREE, 1, 15);
		map[317] = new Terrain(Terrain.TerrainType.TREE, 2, 15);
		map[318] = new Terrain(Terrain.TerrainType.TREE, 3, 15);
		map[319] = new Terrain(Terrain.TerrainType.TREE, 4, 15);
		map[320] = new Terrain(Terrain.TerrainType.TREE, 5, 15);
		map[321] = new Terrain(Terrain.TerrainType.TREE, 6, 15);
		map[322] = new Terrain(Terrain.TerrainType.TREE, 7, 15);
		map[323] = new Terrain(Terrain.TerrainType.TREE, 8, 15);
		map[324] = new Terrain(Terrain.TerrainType.TREE, 9, 15);
		map[325] = new Terrain(Terrain.TerrainType.GRASS, 10, 15);
		map[326] = new Terrain(Terrain.TerrainType.TREE, 11, 15);
		map[327] = new Terrain(Terrain.TerrainType.TREE, 12, 15);
		map[328] = new Terrain(Terrain.TerrainType.TREE, 13, 15);
		map[329] = new Terrain(Terrain.TerrainType.TREE, 14, 15);
		map[330] = new Terrain(Terrain.TerrainType.TREE, 15, 15);
		map[331] = new Terrain(Terrain.TerrainType.TREE, 16, 15);
		map[332] = new Terrain(Terrain.TerrainType.TREE, 17, 15);
		map[333] = new Terrain(Terrain.TerrainType.TREE, 18, 15);
		map[334] = new Terrain(Terrain.TerrainType.TREE, 19, 15);
		map[335] = new Terrain(Terrain.TerrainType.GRASS, 20, 15);

		// ------------------- R O W 16 ------------------------------------
		map[336] = new Terrain(Terrain.TerrainType.GRASS, 0, 16);
		map[337] = new Terrain(Terrain.TerrainType.GRASS, 1, 16);
		map[338] = new Terrain(Terrain.TerrainType.GRASS, 2, 16);
		map[339] = new Terrain(Terrain.TerrainType.GRASS, 3, 16);
		map[340] = new Terrain(Terrain.TerrainType.TREE, 4, 16);
		map[341] = new Terrain(Terrain.TerrainType.TREE, 5, 16);
		map[342] = new Terrain(Terrain.TerrainType.TREE, 6, 16);
		map[343] = new Terrain(Terrain.TerrainType.GRASS, 7, 16);
		map[344] = new Terrain(Terrain.TerrainType.GRASS, 8, 16);
		map[345] = new Terrain(Terrain.TerrainType.GRASS, 9, 16);
		map[346] = new Terrain(Terrain.TerrainType.GRASS, 10, 16);
		map[347] = new Terrain(Terrain.TerrainType.GRASS, 11, 16);
		map[348] = new Terrain(Terrain.TerrainType.GRASS, 12, 16);
		map[349] = new Terrain(Terrain.TerrainType.GRASS, 13, 16);
		map[350] = new Terrain(Terrain.TerrainType.TREE, 14, 16);
		map[351] = new Terrain(Terrain.TerrainType.TREE, 15, 16);
		map[352] = new Terrain(Terrain.TerrainType.TREE, 16, 16);
		map[353] = new Terrain(Terrain.TerrainType.GRASS, 17, 16);
		map[354] = new Terrain(Terrain.TerrainType.GRASS, 18, 16);
		map[355] = new Terrain(Terrain.TerrainType.GRASS, 19, 16);
		map[356] = new Terrain(Terrain.TerrainType.GRASS, 20, 16);

		// ------------------- R O W 17 ------------------------------------
		map[357] = new Terrain(Terrain.TerrainType.GRASS, 0, 17);
		map[358] = new Terrain(Terrain.TerrainType.GRASS, 1, 17);
		map[359] = new Terrain(Terrain.TerrainType.GRASS, 2, 17);
		map[360] = new Terrain(Terrain.TerrainType.GRASS, 3, 17);
		map[361] = new Terrain(Terrain.TerrainType.GRASS, 4, 17);
		map[362] = new Terrain(Terrain.TerrainType.TREE, 5, 17);
		map[363] = new Terrain(Terrain.TerrainType.GRASS, 6, 17);
		map[364] = new Terrain(Terrain.TerrainType.GRASS, 7, 17);
		map[365] = new Terrain(Terrain.TerrainType.GRASS, 8, 17);
		map[366] = new Terrain(Terrain.TerrainType.GRASS, 9, 17);
		map[367] = new Terrain(Terrain.TerrainType.GRASS, 10, 17);
		map[368] = new Terrain(Terrain.TerrainType.GRASS, 11, 17);
		map[369] = new Terrain(Terrain.TerrainType.GRASS, 12, 17);
		map[370] = new Terrain(Terrain.TerrainType.GRASS, 13, 17);
		map[371] = new Terrain(Terrain.TerrainType.GRASS, 14, 17);
		map[372] = new Terrain(Terrain.TerrainType.TREE, 15, 17);
		map[373] = new Terrain(Terrain.TerrainType.GRASS, 16, 17);
		map[374] = new Terrain(Terrain.TerrainType.GRASS, 17, 17);
		map[375] = new Terrain(Terrain.TerrainType.GRASS, 18, 17);
		map[376] = new Terrain(Terrain.TerrainType.GRASS, 19, 17);
		map[377] = new Terrain(Terrain.TerrainType.GRASS, 20, 17);

		// ------------------- R O W 18 ------------------------------------
		map[378] = new Terrain(Terrain.TerrainType.GRASS, 0, 18);
		map[379] = new Terrain(Terrain.TerrainType.GRASS, 1, 18);
		map[380] = new Terrain(Terrain.TerrainType.GRASS, 2, 18);
		map[381] = new Terrain(Terrain.TerrainType.GRASS, 3, 18);
		map[382] = new Terrain(Terrain.TerrainType.GRASS, 4, 18);
		map[383] = new Terrain(Terrain.TerrainType.TREE, 5, 18);
		map[384] = new Terrain(Terrain.TerrainType.GRASS, 6, 18);
		map[385] = new Terrain(Terrain.TerrainType.GRASS, 7, 18);
		map[386] = new Terrain(Terrain.TerrainType.GRASS, 8, 18);
		map[387] = new Terrain(Terrain.TerrainType.GRASS, 9, 18);
		map[388] = new Terrain(Terrain.TerrainType.GRASS, 10, 18);
		map[389] = new Terrain(Terrain.TerrainType.GRASS, 11, 18);
		map[390] = new Terrain(Terrain.TerrainType.GRASS, 12, 18);
		map[391] = new Terrain(Terrain.TerrainType.GRASS, 13, 18);
		map[392] = new Terrain(Terrain.TerrainType.GRASS, 14, 18);
		map[393] = new Terrain(Terrain.TerrainType.TREE, 15, 18);
		map[394] = new Terrain(Terrain.TerrainType.GRASS, 16, 18);
		map[395] = new Terrain(Terrain.TerrainType.GRASS, 17, 18);
		map[396] = new Terrain(Terrain.TerrainType.GRASS, 18, 18);
		map[397] = new Terrain(Terrain.TerrainType.GRASS, 19, 18);
		map[398] = new Terrain(Terrain.TerrainType.GRASS, 20, 18);

		// ------------------- R O W 19 ------------------------------------
		map[399] = new Terrain(Terrain.TerrainType.TREE, 0, 19);
		map[400] = new Terrain(Terrain.TerrainType.TREE, 1, 19);
		map[401] = new Terrain(Terrain.TerrainType.GRASS, 2, 19);
		map[402] = new Terrain(Terrain.TerrainType.GRASS, 3, 19);
		map[403] = new Terrain(Terrain.TerrainType.GRASS, 4, 19);
		map[404] = new Terrain(Terrain.TerrainType.TREE, 5, 19);
		map[405] = new Terrain(Terrain.TerrainType.GRASS, 6, 19);
		map[406] = new Terrain(Terrain.TerrainType.GRASS, 7, 19);
		map[407] = new Terrain(Terrain.TerrainType.TREE, 8, 19);
		map[408] = new Terrain(Terrain.TerrainType.TREE, 9, 19);
		map[409] = new Terrain(Terrain.TerrainType.GRASS, 10, 19);
		map[410] = new Terrain(Terrain.TerrainType.GRASS, 11, 19);
		map[411] = new Terrain(Terrain.TerrainType.GRASS, 12, 19);
		map[412] = new Terrain(Terrain.TerrainType.GRASS, 13, 19);
		map[413] = new Terrain(Terrain.TerrainType.GRASS, 14, 19);
		map[414] = new Terrain(Terrain.TerrainType.TREE, 15, 19);
		map[415] = new Terrain(Terrain.TerrainType.GRASS, 16, 19);
		map[416] = new Terrain(Terrain.TerrainType.GRASS, 17, 19);
		map[417] = new Terrain(Terrain.TerrainType.GRASS, 18, 19);
		map[418] = new Terrain(Terrain.TerrainType.TREE, 19, 19);
		map[419] = new Terrain(Terrain.TerrainType.TREE, 20, 19);

		// ------------------- R O W 20 ------------------------------------
		map[420] = new Terrain(Terrain.TerrainType.TREE, 0, 20);
		map[421] = new Terrain(Terrain.TerrainType.TREE, 1, 20);
		map[422] = new Terrain(Terrain.TerrainType.GRASS, 2, 20);
		map[423] = new Terrain(Terrain.TerrainType.GRASS, 3, 20);
		map[424] = new Terrain(Terrain.TerrainType.GRASS, 4, 20);
		map[425] = new Terrain(Terrain.TerrainType.GRASS, 5, 20);
		map[426] = new Terrain(Terrain.TerrainType.GRASS, 6, 20);
		map[427] = new Terrain(Terrain.TerrainType.GRASS, 7, 20);
		map[428] = new Terrain(Terrain.TerrainType.TREE, 8, 20);
		map[429] = new Terrain(Terrain.TerrainType.TREE, 9, 20);
		map[430] = new Terrain(Terrain.TerrainType.GRASS, 10, 20);
		map[431] = new Terrain(Terrain.TerrainType.GRASS, 11, 20);
		map[432] = new Terrain(Terrain.TerrainType.GRASS, 12, 20);
		map[433] = new Terrain(Terrain.TerrainType.GRASS, 13, 20);
		map[434] = new Terrain(Terrain.TerrainType.GRASS, 14, 20);
		map[435] = new Terrain(Terrain.TerrainType.GRASS, 15, 20);
		map[436] = new Terrain(Terrain.TerrainType.GRASS, 16, 20);
		map[437] = new Terrain(Terrain.TerrainType.GRASS, 17, 20);
		map[438] = new Terrain(Terrain.TerrainType.GRASS, 18, 20);
		map[439] = new Terrain(Terrain.TerrainType.TREE, 19, 20);
		map[440] = new Terrain(Terrain.TerrainType.TREE, 20, 20);

	}

	public Terrain[] getMapData() {
		return map;
	}

	@Override
	public int getMapWidth() {
		return MAP_WIDTH;
	}

	@Override
	public int getMapHeight() {
		return MAP_HEIGHT;
	}

	@Override
	public Terrain getTerrainAt(int x, int y) {

		for (Terrain terrain : map) {

			if (terrain.getX() == x) {
				if (terrain.getY() == y) {
					return terrain;
				}
			}
		}

		return null;
	}

	@Override
	public Player initializePlayerCoords(Player player) {

		if (player != null) {
			boolean terrainFound = false;
			
			int randomStart = (int) (Math.random() * map.length);

			for (int i = randomStart; i < map.length; i++) {
				Terrain terrain = map[i];
				if (terrain != null) {
					if (terrain.getType() == Terrain.TerrainType.GRASS) {
						player.setX(terrain.getX());
						player.setY(terrain.getY());
						terrainFound = true;
						break;
					}
				}
			}
			
			// just in case it doesn't find a terrain, do the whole thing again 
			// until it finds a valid points.
			if(! terrainFound)
			{
				initializePlayerCoords(player);
			}
		}

		return player;
	}

	@Override
	public void updateTerrain(Terrain aterr) {
		if(map != null)
		{
			for (int i = 0; i < map.length; i++) {
				Terrain terrain = map[i];
				if (terrain != null) {
					if (aterr.getX() == terrain.getX()) {
						if (aterr.getY() == terrain.getY()) {
							map[i] = aterr;
							break;
						}
					}
				}
			}
		}
		
	}
}